#include<iostream>
#include<stdio.h>
using namespace std;

class CClassA
{
public:
    virtual void Print()
    {
        printf("A ");
    }
};
void PrintFunc(CClassA a)
{
    a.Print();
}

class CClassB:public CClassA
{
public:
    virtual void Print()
    {
        printf("B ");
    }
};
void PrintFunc(CClassA *pa)
{
    pa->Print();
}

int main(void)
{
    CClassB b;
    PrintFunc(b);
    PrintFunc(&b);
    return 0;
}
